<style lang="less" scoped>
.fullsearch {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #fff;
    z-index: 600500;
    .comphead {
        position: fixed;
        width: 100%;
        height: 0.44rem;
        top: 0;
        left: 0;
        z-index: 10000;
    }
}
</style>
<template>
    <div class="fullsearch">
        <CompHead class="comphead" @onSearch="onSearch" @onCancle="onCancle" />
        <CompHistory :tags="tags" @onSearch="onSearch" />
    </div>
</template>
<script>
import CompHead from "./comp/head";
import CompHistory from "./comp/history";
import { HistorySearch } from "@/storage";
export default {
    data() {
        return {
            list: [],
            tags: [],
            pageData: {}
        };
    },
    props: {
        value: {
            type: Boolean,
            default: false
        }
    },
    components: {
        CompHead,
        CompHistory
    },

    methods: {
        getTags(){
            var list = HistorySearch();
            this.tags = list;
        },

        onSearch(keyword) {
            this.$emit("onSearch", keyword);
        },

        onCancle() {
            this.$emit("onCancle");
        }
    },
    watch: {
        value: function(){
            this.getTags();
        }
    },
    mounted() {
        this.getTags();
    }
};
</script>
